/**
 * Copyright(C) 2008 Matthias Braunhofer
 * All rights reserved
 *
 * Created on: 23.08.2008
 */

package it.cums.core.util;

import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.PlatformUI;

public class MessageCreator {
	
	public static void showErrorMessage(String message) {
		MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Error", message);
	}
	
	public static void showInformationMessage(String message) {
		MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Information", message);
	}
	
	public static void showWarningMessage(String message) {
		MessageDialog.openWarning(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Warning", message);		
	}
	
	public static boolean showConfirmMessage(String message) {
		return MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Confirm", message);
	}
	
	public static boolean showQuestionMessage(String message) {
		return MessageDialog.openQuestion(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Question", message);
	}
	
	public static String showInputMessage(String message) {
		InputDialog dialog = new InputDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Input", message, "", null);
		dialog.open();
		return dialog.getValue();
	}
}
